package models

import (
	"gorm.io/gorm"
	"hitme/go-api/modules/db"
)

var OssFileModel = new(OssFile)

// oss文件记录表
type OssFile struct {
	db.CommonModel
	EndPoint        string    `gorm:"type:varchar(255);default:'';NOT NULL;comment:end_point" json:"end_point"`
	AccessKeyId     string    `gorm:"type:varchar(255);default:'';NOT NULL;comment:access_key_id" json:"access_key_id"`
	AccessKeySecret string    `gorm:"type:varchar(255);default:'';NOT NULL;comment:access_key_secret" json:"access_key_secret"`
	BucketName      string    `gorm:"type:varchar(255);default:'';NOT NULL;comment:bucket_name" json:"bucket_name"`
	Object          string    `gorm:"type:varchar(500);default:'';NOT NULL;comment:object" json:"object"`
	Url             string    `gorm:"type:varchar(500);default:'';NOT NULL;comment:url" json:"url"`
}

func (m *OssFile) TableName() string {
	return "oss_file"
}

func (m *OssFile) Model() *gorm.DB {
	return db.MysqlDB.Model(&m)
}